#pragma once
#include "BaseApp.h"
#include "V8Handler.h"

class Renderer : public BaseApp, public CefRenderProcessHandler
{
public:
	Renderer() = default;

	CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() override
	{
		return this;
	}

	void OnContextCreated(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Context> context) override;

	bool OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,
		CefRefPtr<CefFrame> frame,
		CefProcessId source_process,
		CefRefPtr<CefProcessMessage> message) override;

private:
	CefRefPtr<V8Handler> m_v8Handler;
	IMPLEMENT_REFCOUNTING(Renderer);

};

